package dsa.ch01;

public class Count10To2 {
    public static void main(String[] args) {
        int num = 441;
        System.out.println(countOnes(441));
    }

    static int countOnes(int n) {
        int ones = 0;
        while (n > 0) {
            ones +=(1&n);
            n >>= 1;
        }
        return ones;
    }
}
